package com.yckj.day07;

/**
 * TODO  父类
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/24 11:29
 */
public class Person /*extends  Object*/{ // Object是顶级父类，这里省略了extends Object
    public String name = "李四";
    public int age = 50;
    double weight;
    private String sex;
    protected String address;
    public Person(){
        System.out.println("父类无参构造方法");
    }
    public Person(String name){
        this.name = name;
    }
    public  void eat(){
        System.out.println("吃饭");
    }
    void work(){
        System.out.println("劳动");
    }

    protected void sleep(){
        System.out.println("睡觉");
    }
    private void test(){
        System.out.println("测试");
    }
}
